Standard Equation of the Ellipse

$Ax^2+Bxy+Cy^2+Dx+Ey=-F$ General Form Conic

$$\frac{(x-h)^2}{a^2} + \frac{(y-k)^2}{b^2}=1 \tag{1} \label{1}$$ Standard elliptical form requires a "1" on the right side.

In this section we will work with the general form conic ellipse. Along the way we will show how to get a parametric equation from that general form.

The general form equation for a conic will permit it to be rotated within the plane such that the major axis is oriented at any angle to the $x$ axis. This Cartesian equation requires some linear algebra skills to be helpful. But there are a few things that we can discuss before that. The discriminant, $B^{2}-4AC$ is indicative of the conic shape. When the discriminant is less than zero then the shape will be elliptical, unless it is degenerate. The degenerate ellipse in elliptic form will be equal to zero. $$\frac{(x-h)^2}{a^2} + \frac{(y-k)^2}{b^2}=0 \tag{2} \label{2}$$ So long as the $xy$ term in the general form conic is zero, then you can transform the equation into elliptic form by completing the square in both $x$ and $y$. Having done so, if you get the form of $\eqref{2}$ and it is equal to zero then the ellipse is degenerate. $$B^{2}-4AC<0\qquad\text{Ellipse}$$ $$B^{2}-4AC=0\qquad\text{Parabola}$$ $$B^{2}-4AC>0\qquad\text{Hyperbola}$$

When the equation is graphed, it will be axis aligned if and only if $B=0$. If $B\ne0$, then there will be some amount of rotation.

All of the general equations written in variables $x$ and $y$ will reside in the $x,y$ plane. In order to get out of the plane (i.e. from $\mathbb{R}^{2}$ to $\mathbb{R}^{3}$), we have to use $$\begin{aligned} & \left(\begin{array}{c} x\\ y\\ z \end{array}\right)=\left(\begin{array}{c} CP_{x}\\ CP_{y}\\ CP_{z}\\ \end{array}\right)+a\cdot\cos(\theta)\cdot\mathbf{u}+b\cdot\sin(\theta)\cdot\mathbf{v}\\ & \qquad0\le\theta\le2\pi. \end{aligned}$$ which was discussed in the prior section. and we have to establish basis vectors in the new plane of interest. Since this section concerns equations in variables, $x$ and $y$, we will be in the standard $\mathbb{R}^{2}$ plane.

Elliptic Center

From the general form, obtain the two partial derivatives, set them to zero, and solve for $x$ and $y$ to get the center of the ellipse. This works whether or not the ellipse is rotated.

Example: Find the center of an ellipse given by $5x^{2}-10xy+16y^{2}-30x-20y=-70$.
Answer: $$\frac{\partial f}{\partial x}=10x-10y-30=0$$ $$\frac{\partial f}{\partial y}=-10x+32y-20=0$$ Solving simultaneously, $x=58/11$ and $y=25/11$. This works because we want the coefficients of the conic terms of degree 1 to be zero and that is achieved by the gradient equations being set to zero. Finding the center is the easiest way to translate the equation to the origin.

Translation

It is easy to translate the ellipse to the origin. For most everyone, that means pick up the ellipse and move it, without rotation, to have its center at $(0,0)$.

Aside: Suppose we have a function such as $x^{2}+y^{2}=0.1^{2}$. This is a very small circle around the origin. What do we do in order to translate that circle to a new center, such as $(2,3)$? We probably recall that the equation of a circle with center $(h,k)$ is $(x-h)^{2}+(y-k)^{2}=r^{2}$, therefore to move the circle to $(2,3)$, we would need to write $(x-2)^{2}+(y-3)^{2}=.1^{2}$ If we wanted to reverse this procedure, and move a circle from $(h,k)$ to the origin, we just write $(x+h-h)^{2}+(y+k-k)^{2}=0.1^{2}$. It works the same for a more complicated equation, such as an ellipse.

To do that, we write the ellipse as $$\begin{aligned} & A(x+h)^{2}+B(x+h)(y+k)\\ & +C(y+k)^{2}+D(x+h)\\ & +E(y+k)=-F \end{aligned}.$$ Notice that we have algebraically moved $F$ to the right hand side. If the algebra gets done correctly, then, when simplified, we will get a new set of coefficients and the terms in $x$ and $y$ will disappear.

Matrix Translation.png
Figure 1: The figure shows an original ellipse (red and not centered at the origin) and then the same ellipse translated to the origin. The equation of the original ellipse is $8x^{2}+4xy+5y^{2}-42x-24y=-63$ and the equation of the translated ellipse is $8x^{2}+4xy+5y^{2}=2.25$. On translation, the monomial terms for $x$ and $y$ have cancelled out with a consequent change in the remaining constant term.
Example
Suppose we start with ellipse $$8\;x^{2}+4\;x\;y+5\;y^{2}-42\;x-24\;y+63=0.$$ Before we can translate it, we need to get its center. The two equations are the partial derivative of the ellipse with respect to $x$ and the partial derivative of the ellipse with respect to $y$. $$\nabla f=\left(\begin{array}{c} 16\;x+4\;y-42\\ 4\;x+10\;y-24 \end{array}\right)=0$$ We can solve these two equations simultaneously to get $(x,y)=(9/4,\;3/2)$. Now that we know where the ellipse center is, we can set up the equations to move it to the origin. For each $x$ term, substitute $(x+9/4)$ and for each $y$ term substitute $(y+3/2)$. $$\begin{aligned} & 8\left(x+\frac{9}{4}\right)^{2}+4\left(x+\frac{9}{4}\right)\left(y+\frac{3}{2}\right)\\ & +5\left(y+\frac{3}{2}\right)^{2}-42\left(x+\frac{9}{4}\right)\\ & -24\left(y+\frac{3}{2}\right)+63=0 \end{aligned} $$ On expanding the equation and consolidating the constant term we get $$8\;x^{2}+4\;x\;y+5\;y^{2}-\frac{9}{4}=0$$ and we see that the $x$ and $y$ monomials have been resolved.

General Conic Form

The general form of an ellipse given by $Ax^{2}+Bxy+Cy^{2}+Dx+Ey+F=0$ can be written in matrix form as $$(x,y)\left(\begin{array}{cc} A & B/2\\ B/2 & C \end{array}\right)\left(\begin{array}{c} x\\ y \end{array}\right)+\left(D,E\right)\left(\begin{array}{c} x\\ y \end{array}\right)+F=0.$$ The $2\times2$ matrix has eigenvectors which when orthogonalized (i.e. made into unit vectors) constitute the basis vectors for the ellipse. Using the example ellipse, $8x^{2}+4xy+5y^{2}-42x-24y=-63$ $$Q\,:=\,\left(\begin{array}{cc} 8 & \frac{4}{2}\\ \frac{4}{2} & 5 \end{array}\right)$$ The eigenvalues come from the characteristic equation, we have $$(\lambda_{2},\lambda_{1})=\left(\begin{array}{cc} 8-\lambda & \frac{4}{2}\\ \frac{4}{2} & 5-\lambda \end{array}\right)=\lambda^{2}-13\lambda+36=0$$ $$\lambda_{1}=4\quad\lambda_{2}=9$$ To get the eigenvector, we write the vector equations: $$\left(\begin{array}{cc} 8 & 2\\ 2 & 5 \end{array}\right)\left(\begin{array}{c} x\\ y \end{array}\right)=\lambda_{1}\left(\begin{array}{c} x\\ y \end{array}\right)$$ and solve either one with $\lambda_{1}=4$. Using the top equation, $$8x+2y=4x$$ $$4x=-2y$$ $$2x=-y$$ let $x=1$,then $y=-2$ $$\mathbf{u}=\left(\begin{array}{c} 1\\ -2 \end{array}\right)\text{ matches with }\lambda=4$$ and with $\lambda_{2}$, I used the other vector equation here, but it does not matter. What matters is which eigenvalue is plugged in. $$2x+5y=9y$$ $$2x=4y$$ $$x=2y$$ let $x=2$, then $y=1$ $$\mathbf{v}=\left(\begin{array}{c} 2\\ 1 \end{array}\right)$$

These two vectors are graphed in figure 2 and a quick glance at the graph will show you that they align with the axes of the rotated ellipse. That could be useful.

There is one important thing to be done, and that is to normalize these eigenvectors. Otherwise, they will not serve a basis vectors in our parametric equation. $$\hat{\mathbf{u}}=\frac{\left(\begin{array}{c} 1\\ -2 \end{array}\right)}{\left\Vert \left(\begin{array}{c} 1\\ -2 \end{array}\right)\right\Vert }\qquad\qquad\hat{\mathbf{v}}=\frac{\left(\begin{array}{c} 2\\ 1 \end{array}\right)}{\left\Vert \left(\begin{array}{c} 2\\ 1 \end{array}\right)\right\Vert }$$ Putting some calculator numbers into all of this gets $$CenterP=\left(\begin{array}{c} 9/4\\ 3/2 \end{array}\right)$$ $$\hat{\mathbf{u}}=\left(\begin{array}{c} -0.8944\\ 0.4472 \end{array}\right)\qquad\qquad\hat{\mathbf{v}}=\left(\begin{array}{c} -0.4472\\ 0.8944 \end{array}\right)$$ and our parametrized equation can be written symbolically as $$\begin{aligned} & \left(\begin{array}{c} x\\ y \end{array}\right)=CenterP+a\cdot\cos(t)\cdot\hat{\mathbf{u}}+b\cdot sin(t)\cdot\hat{\mathbf{v}}\\ & 0 \le t\le2\pi. \end{aligned}$$ But we still haven't found values for $a$ and $b$. To get $a$ and $b$, we can set about to find the vertices. (Aside: $a=3/4$ and $b=1/2$.)

One method to find the vertices is to rotate the ellipse into axes alignment. Since we know the eigenvectors, we can easily determine the rotation angle needed. It is $atan2(u_{y},u_{x})$ or $atan2(v_{y},v_{x})$ or $\arg(\mathbf{u)}$ or $\arg(\mathbf{v).}$ The results which differ by $\pi/2$, are $$\arg\left(\mathbf{u}\right)=2.0344\,rad=\theta_{1}$$ $$\arg(\mathbf{v})=0.4636\,rad=\theta_{2}$$ Our ellipse equation is $8x^{2}+4xy+5y^{2}-42x-24y=-63$, and the substitutions for rotation are $$\begin{array}{c} x=x_{1}\cos\theta-y_{1}\sin\theta\\ y=x_{1}\sin\theta+y_{1}\cos\theta \end{array}$$ which, after substituting and dropping the subscripts is $$\begin{aligned} & 8(x\cos\theta-y\sin\theta)^{2}\\ & +4(x\cos\theta-y\sin\theta)(x\sin\theta+y\cos\theta)\\ & +5(x\sin\theta+y\cos\theta)^{2}\\ & -42(x\cos\theta-y\sin\theta)\\ & -24(x\sin\theta+y\cos\theta)\\ & =-63 \end{aligned} $$

Matrix_Translation_1.png
Figure 2: The original ellipse with center point, $CP$, was translated to the origin and then rotated to be aligned with the axes. Once aligned, the distance from the origin to either ellipse intersection with the $x$-axis is distance $a$. Then the vertices of the original ellipse can be obtained from the vector equation $\mathbf{V}=CP\pm a\hat{\mathbf{u}}$.
So that equation is oriented with the axes and after plugging in $\theta=2.0344\,rad$, we get $$4x^{2}+9y^{2}=\frac{9}{4}.$$ One easy way to find the vertices is to set $y=0$ and solve for $x$, and vice versa. $$\text{Horizontal Vertex}=\sqrt{\frac{9}{16}}=\frac{3}{4}=a$$ $$\text{Vertical Vertex} =\sqrt{\frac{1}{4}}=\frac{1}{2}=b$$ Now we can compute the vertices of the original ellipse using vector projection. $$\begin{aligned} & \left(\begin{array}{c} V_{1}\\ V_{2} \end{array}\right)=CP\pm a\hat{\mathbf{u}}\\ & =CP\pm a\left(\begin{array}{c} -0.8944\\ 0.4472 \end{array}\right)\\ & =\left(\begin{array}{c} 1.9146\\ 2.1708 \end{array}\right)\text{ and }\left(\begin{array}{c} 2.5854\\ 0.8292 \end{array}\right) \end{aligned} $$

Example: Given the ellipse $0.4x^2-0.65xy+0.8y^2+4x+6.5y=-40$, find the semi-major axis and vertices of the major axis.
Answer: Get the center point of the ellipse by setting the gradient equations to zero and solving for $x$ and $y$. $$\nabla f=\left(\begin{array}{c} \frac{4}{5}x-\frac{13}{20}y+4\\ \frac{8}{5}y-\frac{13}{20}x+\frac{13}{2} \end{array}\right)=\left(\begin{array}{c} 0\\ 0 \end{array}\right)$$ $$CP=\left(\begin{array}{c} x\\ y \end{array}\right)=\left(\begin{array}{c} -\frac{4250}{343}\\ -\frac{3120}{343} \end{array}\right)\approx\left(\begin{array}{c} -12.391\\ -9.096 \end{array}\right)$$ Now translate the equation to the origin. $$\begin{aligned} & \frac{4}{10}\left(x-\frac{4250}{343}\right)^{2}\\ & -\frac{65}{100}\left(x-\frac{4250}{343}\right)\left(y-\frac{3120}{343}\right)\\ & +\frac{8}{10}\left(y-\frac{3120}{343}\right)^{2}\\ & +4\left(x-\frac{4250}{343}\right)\\ & +\frac{65}{10}\left(y-3120\right)=-40 \end{aligned}$$ after expanding, multiplying both sides by 2, and simplifying, $$\frac{4}{5}x^{2}-\frac{13}{10}xy+\frac{8}{5}y^{2}=-80+\frac{37280}{343} \tag{3} \label{3}$$ which is a rotated ellipse centered at $(0,0)$.
example_ellipse.png
Figure 2: The original ellipse has center point $CP$. Its equation is $0.4x^2-0.65xy+0.8y^2+4x+6.5y=-40$. After translation to the origin, we can use eigenvectors $\mathbf{u}$ and $\mathbf{v}$ to find the vertices of the ellipse at the origin. That will yield semi-axes, $a$ and $b$. We can then translate the vertices back to $CP$ to get the original vertices, $V_{1}$ and $V_{2}$.
Next we will write the quadratic form $2\times2$ matrix. $$Q=\left(\begin{array}{cc} \frac{4}{5} & \frac{-13}{20}\\ \frac{-13}{20} & \frac{8}{5} \end{array}\right)$$ The characteristic equation from $Q$ is the $Determinant(Q-\lambda I)$ where $I$ is the $2\times2$ identity matrix. $$\frac{400\;\lambda^{2}-960\;\lambda+343}{400}=0$$ $$\left(\begin{array}{c} \lambda_{1}\\ \lambda_{2} \end{array}\right)=\left(\begin{array}{c} \frac{-\sqrt{233}+24}{20}\\ \frac{\sqrt{233}+24}{20} \end{array}\right)$$ The eigenvector equations are $$\left(\begin{array}{c} \frac{4}{5}x-\frac{13}{20}y\\ -\frac{13}{20}x+\frac{8}{5}y \end{array}\right)=\lambda\left(\begin{array}{c} x\\ y \end{array}\right)$$ Letting $x=1$, and using $\lambda_{1}$ we get $$\mathbf{u}=\left(\begin{array}{c} 1\\ \frac{\sqrt{233}-8}{13} \end{array}\right)\text{ matching with }\lambda_{1}\text{ which is the long axis.}$$ Letting $x=1$, and using $\lambda_{2}$ we get $$\mathbf{v}=\left(\begin{array}{c} 1\\ \frac{-\sqrt{233}-8}{13} \end{array}\right)\text{matching with }\lambda_{2}\text{ which is the short axis.}$$ We could make a line out of vector $\mathbf{u}$. If we noticed that slope is $$slope=\frac{\mathbf{u_{y}}}{\mathbf{u_{x}}}\approx0.559$$ and the line intersecting the origin is $y=0.559x$. That could be substituted into $\eqref{3}$ and we could solve for the vertices of the origin centered ellipse. Here is the equation: $$\frac{4}{5}x^{2}-\frac{13}{10}xy+\frac{8}{5}y^{2}=-80+\frac{37280}{343}$$ and here is the substitution: $$\frac{4}{5}x^{2}-\frac{13}{10}x\left(x\cdot\frac{\sqrt{233}-8}{13}\right)+\frac{8}{5}\left(x\cdot\frac{\sqrt{233}-8}{13}\right)^{2}=\frac{9840}{343}$$ $$\frac{1}{1690}x^{2}\left(-425\sqrt{233}+7456\right)=\frac{9840}{343}$$ which can be solved for the $x$ part of the two vertices. $$x=\pm20\frac{\sqrt{57318\left(425\sqrt{233}+7456\right)}}{79919}=\pm7.075$$ and plugged in to get the $y$ part. $$y=\pm7.075\left(\frac{\sqrt{233}-8}{13}\right)=\pm3.953.$$ That is, for the origin vertices, $$\left(\begin{array}{c} x\\ y \end{array}\right)=\left(\begin{array}{c} 7.075\\ 3.953 \end{array}\right)\text{and }\left(\begin{array}{c} -7.075\\ -3.953 \end{array}\right) \tag{4} \label{4}$$ To get the value for $a$, we just need the distance from a vertex to the origin. $$a=\left\Vert \left(\begin{array}{c} 7.075\\ 3.953 \end{array}\right)\right\Vert =8.104$$ and to get the original ellipse vertices, we can translate $\eqref{4}$ to our center point. $$\text{Vertices}=\left(\begin{array}{c} \frac{-4250}{343}\\ \frac{-3120}{343} \end{array}\right)\pm\left(\begin{array}{c} 7.075\\ 3.953 \end{array}\right)$$ $$\left(\begin{array}{c} V_{1}\\ V_{2} \end{array}\right)=\left(\begin{array}{c} (-5.316,-5.143)\\ (-19.465,-13.050) \end{array}\right)$$